feat(go/plugins/googlegenai): Support tuned Gemini endpoint models#5178
Open
cabljac wants to merge 3 commits into
Open
feat(go/plugins/googlegenai): Support tuned Gemini endpoint models#5178cabljac wants to merge 3 commits into
cabljac wants to merge 3 commits into
Conversation
Accept Vertex AI tuned endpoints addressed either by the short form `endpoints/ID` or the full resource path `projects/PROJECT/locations/LOCATION/endpoints/ID`. ClassifyModel now routes these names to ModelTypeGemini, and a new resolveVertexModelName helper expands the short form to the full path before the google.golang.org/genai SDK transforms it, avoiding the SDK's default `publishers/google/models/` prefix that only applies to first-party models. VertexAI.DefineModel also accepts tuned endpoint names with a nil options argument, falling back to the default Gemini capability set. Adds unit tests for ClassifyModel and isTunedGeminiName, and a live subtest in vertexai_live_test.go gated by GENKIT_VERTEX_TUNED_ENDPOINT. Mirrors the JS behaviour in js/plugins/google-genai/src/vertexai/client.ts.
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces support for Vertex AI tuned Gemini endpoints, allowing them to be addressed via short-form or full resource paths. Key changes include the addition of a name resolution helper, updates to model classification logic, and modifications to the model definition process to accommodate these dynamic endpoints. A critical feedback point identifies that tuned endpoints, which are not in the static model list, would receive empty model options; a suggestion was provided to use default Gemini options instead to ensure proper capability support.
cabljac
added a commit
that referenced
this pull request
Apr 23, 2026
Accepts Vertex AI tuned endpoints addressed either by the short form `endpoints/ID` or the full resource path `projects/PROJECT/locations/LOCATION/endpoints/ID`. - gemini.py gains is_tuned_gemini_name() and resolve_vertex_model_name() helpers; both generate_content call sites wrap the model name through the latter so the SDK receives a fully qualified path and skips its default publishers/google/models/ prefixing. - VertexAI._resolve_model routes tuned endpoint names through GeminiModel with the standard Gemini config schema and a sensible label. - Skip list_actions injection — tuned endpoints are private and not publicly listable. - Mirrors the Go PR #5178 design and the JS behaviour in js/plugins/google-genai/src/vertexai/client.ts. - Adds a unit test file covering both helpers and all dispatch paths.
adesinah
suggested changes
May 20, 2026
adesinah
left a comment
There was a problem hiding this comment.
Good changes, I left a few comments.
Exercises the four branches: short form on Vertex (expanded), already fully-qualified path (unchanged), non-tuned name (unchanged), and short form on the Gemini API backend (unchanged). Uses real *genai.Client instances with HTTPClient set to skip ADC lookup so the test stays hermetic.
Tighten isTunedGeminiName so the projects/.../endpoints/... branch only matches the real Vertex resource shape, which always contains /locations/.
adesinah
approved these changes
May 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Accepts Vertex AI tuned Gemini endpoints addressed either by the short form
endpoints/IDor the full resource pathprojects/PROJECT/locations/LOCATION/endpoints/ID.ClassifyModelnow routes these names toModelTypeGemini, and a newresolveVertexModelNamehelper expands the short form to the full path before thegoogle.golang.org/genaiSDK transforms it — avoiding the SDK's defaultpublishers/google/models/prefix, which only applies to first-party models.VertexAI.DefineModelalso accepts tuned endpoint names with aniloptions argument and falls back to the default Gemini capability set.Mirrors
js/plugins/google-genai/src/vertexai/client.ts.Testing